Repository navigation
feat: replace Flask with Rust HTTP server (#45) - #48
Merged
Merged
Conversation
Rust CLI now orchestrates the full compile+serve+watch lifecycle, eliminating Flask, flask-cors, and cryptography as runtime dependencies. Rust changes: - main.rs: add compile_and_serve() — starts Axum HTTP server, opens browser, calls Python --just-compile, enters watch loop with watcher.rs + keyboard.rs - server.rs: add CORS support via tower-http - Wire watcher.rs, build.rs, keyboard.rs (remove dead_code annotations) Python changes: - Delete server_flask.py, debug_routes.py - Simplify compile_native.py to compile-only (no server/watch) - open_browser.py: spawn_http_server() now launches Rust CLI --serve-dir - Remove Flask, flask-cors, cryptography from pyproject.toml Tests: - Delete test_debug_routes.py (debug routes deferred) - Update integration tests for HTTP-only (localhost is secure context)
10 tasks
zackees
added a commit
that referenced
this pull request
Apr 12, 2026
- Delete MicrophoneHttpsIntegrationTest class (HTTPS dropped in PR #48) - Keep MicrophoneDemoValidationTest for micdemo.html content validation - Remove #39 tracking references from skip markers - Add test_http_server.py: HTTP smoke test using the Rust CLI binary - Fix pre-existing pyright errors (playwright import suppressions) - Fix pre-existing black formatting in playwright module
2 of 3 tasks
zackees
added a commit
that referenced
this pull request
Apr 12, 2026
- Delete MicrophoneHttpsIntegrationTest class (HTTPS dropped in PR #48) - Keep MicrophoneDemoValidationTest for micdemo.html content validation - Remove #39 tracking references from skip markers - Add test_http_server.py: HTTP smoke test using the Rust CLI binary - Fix pre-existing pyright errors (playwright import suppressions) - Fix pre-existing black formatting in playwright module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compile_and_serve()inmain.rsstarts the Axum HTTP server, opens the browser, calls Python--just-compile, and enters a file-watching loop usingwatcher.rs+keyboard.rsFlask,flask-cors, andcryptographyfrompyproject.toml(net -111 lines of dependencies)server_flask.py(226 lines),debug_routes.py(47 lines), and their testWhat changed
Rust
main.rs: Newcompile_and_serve()function + routing inmain()for the normal compilation flowserver.rs: Added CORS layer viatower-httpbuild.rs,watcher.rs,keyboard.rs: Removed#![allow(dead_code)]— now wired inPython
compile_native.py: Stripped to compile-only (no server spawn, no watch loop)open_browser.py:spawn_http_server()now launchesfastled --serve-diras a subprocessapp.py:--serve-dirpath returns error pointing to Rust CLIpyproject.toml: Removed Flask, flask-cors, cryptographyTests
test_debug_routes.py(debug routes deferred to follow-up)Design decisions
localhostis a secure context in all browsers — HTTPS/TLS deferred/dwarfsourceand/debug/source-rootsrequire portingDebugSymbolResolverto Rust — follow-up PRTest plan
cargo test -p fastled-cli— 55 tests passbash test— 119 Python tests passbash lint— all checks pass (cargo fmt, clippy, ruff, black, isort, pyright)